from django.db import models


# Create your models here.
class bookDisplay(models.Model):
    chapter_number = models.IntegerField(help_text=u"章节号")
    novel_number = models.IntegerField(help_text=u"书名号")
    book_name = models.TextField(help_text=u"书名")
    book_content = models.TextField(help_text=u"书籍内容")

    class Meta:
        ordering = ["chapter_number"]


class books(models.Model):
    book_name = models.TextField(help_text=u"书名")
    book_author = models.TextField(help_text=u"作者")
    book_introduction = models.TextField(help_text=u"简介")
    novel_number = models.IntegerField(help_text=u"小说编号")
    book_cover = models.ImageField(upload_to='book_cover', help_text=u"封面")
    novel_type = models.TextField(help_text=u"小说类型")
    hits = models.IntegerField(default=0, help_text=u"点击量")
    praise_len = models.IntegerField(default=0, help_text=u"点赞数")
    recommend = models.IntegerField(default=0, help_text=u"推荐度")
    create_time = models.DateTimeField(auto_now_add=True, help_text=u"创建时间")
    update_time = models.DateTimeField(auto_now=True, help_text=u"更新时间")
    new_chapter = models.TextField(help_text=u"最新章节")
    total_chapter = models.IntegerField(default=0, help_text=u"总章节数")
